home *** CD-ROM | disk | FTP | other *** search
/ Gekikoh Dennoh Club 1 / Gekikoh Dennoh Club Vol. 1 (Japan).7z / Gekikoh Dennoh Club Vol. 1 (Japan) (Track 1).bin / kowin / dockob / rot.kob < prev    next >
Encoding:
Text File  |  1995-11-13  |  2.9 KB  |  152 lines

  1. /**************************************
  2. /* 回れ回れ for こB!   by v914AKSTN *
  3. /**************************************
  4.  
  5.  
  6. /********************
  7. /* 起動時の初期設定 *
  8. /********************
  9. dim char map(24*24)
  10. dim int vec(3)={ -24, 1, 24, -1 }
  11. dim str arrow(4)={ "↑", "→", "↓", "←", "×" }
  12. int i,j
  13. int sc,x,m,r,l
  14. int flag=1
  15.  
  16.  
  17. /******************************
  18. /* ウィンドウオープン!!!! *
  19. /******************************
  20. WindowTitleOpen( 0, WINX, WINY, 384,384, 0, "回れ回れ for こB!", 2 )
  21. WindowTitleOpen( 1, WINX+390, WINY, 128,60, 0, "回れ回れ", 3 )
  22. end
  23. /******************
  24. /* 初期設定終わり *
  25. /******************
  26.  
  27.  
  28.  
  29. /******************************************
  30. /* 再描画する必要が生じた時、呼び出される *
  31. /******************************************
  32. func Eredraw(wno)
  33.     int i,j,a
  34.     str s
  35.  
  36.     DrawClear( wno, 1 )        /* ウィンドウを灰色でクリア
  37.     switch wno
  38.     case 0:
  39.  
  40.         if flag then {
  41.             if flag=1 then {    /* ゲーム初期化処理
  42.                 sc=0:x=12+12*24:m=0:l=1
  43.             } else {        /* next level !
  44.                 x=12+12*24:m=0:l=l+1
  45.             }
  46.             flag=0
  47.             for i=0 to 24*24-1
  48.                 map(i)=1    /* ドット
  49.             next
  50.             for i=0 to 23
  51.                 map(i      )=2    /* 壁
  52.                 map(i+23*24)=2
  53.                 map(   i*24)=2
  54.                 map(23+i*24)=2
  55.             next
  56.             for i=1 to 12*l        /* 壁を散らす
  57.                 repeat
  58.                     j=int(rnd()*(24*24))
  59.                 until map(j)=1
  60.                 map(j)=2
  61.             next
  62.             r=22*22-16*l-6
  63.             ITIME=30
  64.         }
  65.  
  66.         a=0
  67.         for i=0 to 23:s=""
  68.             for j=0 to 23
  69.                 switch map(a)
  70.                 case 0:
  71.                     s=s+" "
  72.                     break
  73.                 case 1:
  74.                     s=s+"・"
  75.                     break
  76.                 case 2:
  77.                     s=s+"■"
  78.                     break
  79.                 endswitch
  80.                 a=a+1
  81.             next
  82.             DrawSymbol( 0, 0, i*16, s, 9, 16 )
  83.         next
  84.         break
  85.     case 1:
  86.         DrawSymbol( 1, 16, 8, "score : "+str$(sc), 9, 16 )
  87.         DrawSymbol( 1, 16, 32, "level :   "+str$(l), 9, 16 )
  88.     endswitch
  89. endfunc
  90.  
  91.  
  92.  
  93. /******************************
  94. /* 何か押されたら呼び出される *
  95. /******************************
  96. func Ekey(wno)
  97.     switch info_KeyCode
  98.     case 13:
  99.         if ITIME=-1 then {
  100.             flag=1    /* ゲーム初期化
  101.             WindowRedraw( 0 )
  102.             WindowRedraw( 1 )
  103.         }
  104.         break
  105.     case 32:
  106.         m=(m+1)and 3    /* 右に曲げる
  107.     endswitch
  108. endfunc
  109.  
  110.  
  111.  
  112. /**********************************
  113. /* ITIME/100 秒ごとに呼び出される *
  114. /**********************************
  115. func Einterval(wno)
  116.     map(x)=0
  117.     DrawSymbol( 0, (x mod 24)*16, (x\24)*16, " ", 9, 16 )
  118.     x=x+vec(m)
  119.     switch map(x)
  120.     case 0:
  121.         ITIME=8
  122.         break
  123.     case 1:
  124.         ITIME=12
  125.         sc=sc+1
  126.         DrawSymbol( 1, 16, 8, "score : "+str$(sc), 9, 16 )
  127.         r=r-1
  128.         if r=0 then {
  129.             repeat
  130.                 j=int(rnd()*(24*24))
  131.             until map(j)=0
  132.             map(j)=3
  133.             DrawSymbol( 0, (j mod 24)*16, (j\24)*16, "C", 9, 16 )
  134.         }
  135.         break
  136.     case 2:
  137.         ITIME=-1
  138.         m=4
  139.         break
  140.     case 3:
  141.         flag=2        /* level up!
  142.         WindowRedraw( 0 )
  143.         WindowRedraw( 1 )
  144.         return(1)
  145.     endswitch
  146.     DrawSymbol( 0, (x mod 24)*16, (x\24)*16, arrow(m), 9, 16 )
  147. endfunc
  148.  
  149. /*******************************
  150. /* プログラム終わり   H7/11/13 *
  151. /*******************************
  152.